<div class="title-menu">
    <h2>Bảng sản phẩm</h2>
</div>
<nav class="bonus">
    <a href="<?php echo base_url("backend/products/add"); ?>">Thêm sản phẩm</a> | <a href="<?php echo base_url("backend/products/deleteall"); ?>" onClick="return confirm('Xác nhận xóa')">Xóa tất cả</a>
</nav>
<article>
    <table cellspacing="0" cellpadding="5" border="1">
        <tr>
            
            <th>Ảnh</th>
            <th>Tên sản phẩm</th>
            <th>Giá</th>
            <th>Kích thước</th>
            <th>Thêm</th>
            <th>Số lượng</th>
            <th>Trạng thái</th>
            <th>Tùy chọn</th>
        </tr>
        <?php
        if (isset($listpro) && count($listpro))
            foreach ($listpro as $pro) {
                ?>
                <tr>
                    
                    <td><img src="<?php echo base_url($pro->img); ?>" width="100"></td>
                    <td><?php echo $pro->name; ?></td>
                    <td><?php echo number_format($pro->price); ?></td>
                    <td><?php echo $pro->size; ?></td>
                    <td><a href="<?php echo base_url("backend/color/view").'/'.$pro->id; ?>">Màu</a><br/>
                        <a href="<?php echo base_url("backend/bonus/view").'/'.$pro->id; ?>">Phụ kiện</a><br/>
                        <a href="<?php echo base_url("backend/images/view").'/'.$pro->id; ?>">Hình ảnh</a><br/>
                        <a href="<?php echo base_url("backend/size/view").'/'.$pro->id; ?>">Kích thước</a>
                    </td>
                    <td><?php echo $pro->qty; ?></td>
                    <td><?php
                        if ($pro->status == 1)
                        echo 'Còn hàng';
                        else
                        echo 'Hết Hàng';
                        ?>
                    </td>
                    <td><a href="<?php echo base_url("backend/products/update").'/'.$pro->id; ?>">Sửa</a> | <a href="<?php echo base_url("backend/products/delete").'/'.$pro->id; ?>" onClick="return confirm('Xác nhận xóa')">Xóa</a></td>
                </tr>        
                <?php
            }
        ?>
    </table>
    <?php if(isset($paging)) echo $paging;?>

</article>